<!DOCTYPE html>
<html>
	<head>
                <meta name="google-translate-customization" content="457c7458d78f1fda-c04c9be73e1a028e-g6dbca1555c3b1007-18"></meta>
                <LINK href="style.css" rel="stylesheet" type-"text/css">
		<title>
			Mariachi Casa Drinks Menu
		</title>
                <style>
                   body {
                      background-image:url('chips-and-salsa.jpg');
                      background-repeat:no-repeat;
                   }
                </style>
	</head>

<!-- ------------------------------------------------------------------- -->
<script>
function help(){
	alert("A waiter is on the way to help you.");
	//send a note to the waiters that this tablet needs help
}
</script>
<!-- ------------------------------------------------------------------- -->



<body>

<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'es', layout: google.translate.TranslateElement.FloatPosition.TOP_LEFT}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

<?php

        // Go back to the first screen.
        echo "<div id=\"backButton\">";
        echo "<form action=\"../home_page/home.php\">";
        echo "<input type=\"submit\" name=\"return\" value=\"Back\" class=\"backButton\"/>";
        echo "</form>";
        echo "</div>"; // Conclude back button.
 
        echo "<h1>Drinks</h1>";
	//contains constraints
	require_once '../database/sql.php';
	session_start(); // gain access to global data

	//load data from table into an associative array
	foreach(sql_load() as $index => $values) {

		//search the master array for the drinks
		if($index == 'drinks') {
			$drinks = $values; //collect drinke elements
			$rows = count($values); //count number of elements
		} //conclude if
	} //conclude loop

				
	//commence table. commence form to return to user to the first screen
	echo "<form method=\"post\" action=\"../home_page/home.php\">\n";
	
	//evaluate drink selections. 
	$counter = 0;
        foreach ($drinks as $arr) { //builds the buttons along the right column
	   if( ( $counter % 2 ) == 0 ) {	
	      echo "<div><input type=\"submit\" name=\"drink\" value=" . 
				"\"{$arr['name']}\" class=\"menuButton\" style=\"float:left\" /></div>\n";
           }
           else {
                echo "<div><input type=\"submit\" name=\"drink\" value=" . "\"{$arr['name']}\" class=\"menuButton\" style=\"position:relative;left:10px\"/></div>\n";
		echo "<br/>\n";
           }
           $counter++;
	} //conclude foreach
 
	echo "</form>\n"; //conclude form

        echo "<br/><br/><br/><br/><br/><br/><br/>";
        // Allows the customer to call for help.
        echo "<div id=\"pageBottom\">";
        echo "<button class=\"footerButton\" onclick=\"\help()">Help</button>";
        echo "</div>";
?>
</body>

</html>
